#coding=utf-8
import urllib
import urllib2

EMAILHTML = 'email.html'
email_html = open(EMAILHTML).read()
SUBJECT = '${name}:-)为你送上圣诞节送礼指南（淘宝篇）!'

url = 'http://xiaojay-lab.appspot.com/receive_ad'
values = {'campaign': '圣诞',
          'subject': SUBJECT,
          'plain': '$email 你好',
          'html': email_html}

data = urllib.urlencode(values)
req = urllib2.Request(url, data)
response = urllib2.urlopen(req)
the_page = response.read()
print the_page
